//
// Created by D00371 on 2021/10/7.
//

#ifndef MOD_AUTH_LDAP_IP_CONTEXTBINDHANDLER_H
#define MOD_AUTH_LDAP_IP_CONTEXTBINDHANDLER_H
#include <memory>
#include <map>
#include <string>
#include <mutex>
#include <regex>
#include <vector>
struct ContextData {
    std::string name;
    std::string host;
    std::string context;
};

class ContextBindHandler {
public:
    static std::shared_ptr<ContextBindHandler> GetInstance();
    void Load(const char* filename);
    bool Check(const char* context, const char* regex);
private:
    std::map<std::string, std::vector<ContextData>> context_buffer;
    std::mutex mutex;
};


#endif //MOD_AUTH_LDAP_IP_CONTEXTBINDHANDLER_H
